package com.boarsoft.boar.sys.biz;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.boarsoft.boar.sys.SysJobBiz;
import com.boarsoft.common.Util;
import com.boarsoft.hibernate.biz.SimpleBizImpl;

@Component("sysJobBiz")
public class SysJobBizImpl extends SimpleBizImpl implements SysJobBiz {
	@Override
	@Transactional
	public void clear() {
		String d = Util.getStdfDateTime();
		// 清除（有效期小于当前日期的）TOKEN
		dao.executeHql(String.format("delete from SysToken where time<'%s'", d));
		// 清除（有效期小于当前日期的）验证码
		dao.executeHql(String.format("delete from SysVerify where time<'%s'", d));
		// 清除（有效期小于当前日期的）邀请码
		dao.executeHql(String.format("delete from SysInvitation where time<'%s'", d));
	}
}